{% extends 'layout.html' %}

{% block home_slogon %}
<ol class="breadcrumb">
  <li><a href="/admin">主页</a></li>
  <li><a href="/admin/content">内容管理</a></li>
</ol>
<h3>修改内容 - {{data.title}}</h3>
<form role="form" method="post">
  <div class="form-gruop">
    <label for="category">分类 </label>
    <select name="category" id="category" class="form-control">
      {% for category in categories %}
      {%if data.category.id.toString() == category._id.toString()%}
      <option value="{{category.id}}" selected>{{category.name}}</option>
      {%else%}
      <option value="{{category.id}}">{{category.name}}</option>
      {%endif%}
      {% endfor %}
    </select>
  </div>
  <div class="form-group">
    <label for="title">标题 </label>
    <input type="text" class="form-control" id="title" placeholder="标题" name="title" value="{{data.title}}">
  </div>
  <div class="form-group">
    <label for="description">简介 </label>
    <textarea name="description" rows="5" id="description" placeholder="简介" class="form-control">{{data.description}}</textarea>
  </div>
  <div class="form-group">
    <label for="content">内容 </label>
    <textarea name="content" rows="8" id="content" placeholder="内容" class="form-control">{{data.content}}</textarea>
  </div>
  <button type="submit" class="btn btn-default">提交</button>
</form>

{% endblock %}
